import App from './App'
import Vue from 'vue'
import store from './store'
// #ifdef H5
import './utils/leancloud-init.js'  //LeanCloud的SDK初始化
// #endif
// #ifdef MP-WEIXIN
import './utils/leancloud-init-wx.js'  //LeanCloud的SDK初始化
// #endif
// 集成uview组件库
import uView from "uview-ui";
Vue.use(uView);
Vue.config.productionTip = false

// 全局注册组件
import NavCustom from 'components/nav-custom.vue'
Vue.component('nav-custom',NavCustom)

import HomeTitle from 'components/home-title.vue'
Vue.component('home-title',HomeTitle)

import CakeItem from 'components/cake-item.vue'
Vue.component('cake-item',CakeItem)


import TestComp from '@/components/test-comp.vue'
Vue.component('test-comp',TestComp)

import TestBus from '@/components/test-bus.vue'
Vue.component('test-bus',TestBus)

import CartPop from '@/components/cart-pop.vue'
Vue.component('cart-pop',CartPop)

import http from './utils/http'
for(let attr in http){
	Vue.prototype[attr] = http[attr]
}
// 等价于
// import {$http,$get,$post} from './utils/http'
// Vue.prototype.$http = $http
// Vue.prototype.$get = $get
// Vue.prototype.$post = $post


App.mpType = 'app'
const app = new Vue({
	store,
    ...App
})
// 集成uview的异步请求方法
require('./utils/request.js')(app)
app.$mount()
